<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path=request.getContextPath(); %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加用户</title>
<script type="text/javascript">
	function checkForm() {
		var loginname=document.getElementById("loginname").value;
		var password=document.getElementById("password").value;
		var prepassword=document.getElementById("prepassword").value;
		if(null==loginname|""==loginname)
		{
			alert("loginname没写");
			return false;
		}
		if(null==password|""==password)
		{
			alert("password没写");
			return false;
		}
		if(password!=prepassword)
		{
			alert("两次密码不同");
			return false;
		}
	}
</script>
</head>
<body>

	<h2 style="text-align: center">用户添加</h2>
	<form action="<%=path %>/StuAction" onsubmit="return checkForm();" method="post">
		<table width="50%" style="margin-left: 25%" border="1">
			<tr>
				<td align="right">姓名：</td>
				<td><input type="text" id="loginname" name="loginname"/></td>
			</tr>
			<tr>
				<td  align="right">密码：</td>
				<td><input type="password" id="password" name="password"/></td>
			</tr>
			<tr>
				<td  align="right">密码：</td>
				<td><input type="password" id="prepassword" name="prepassword"/></td>
			</tr>
			<tr>
				<td style="text-align: right">性别：</td>
		 		<td><input type="radio" id="nan" name="sex" value="男"/>男
					<input type="radio" id="nv" name="sex" checked="checked" value="女"/>女
				</td>
			</tr>
			<tr>
				<td colspan="2" style="text-align: center">	
					<input type="submit" value="提交"/>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>